<template>
	<!-- 移动小窗口按钮示例 -->
	<view>
		<c-fub left="80%" size="128" :turn="false" :opacity="1" bg-color="transparent" @click="openMsg">
			<template slot="center">
				<view class="msg">
					<image class="ms-img" :src="img" mode="">
					</image>
					<view v-if="msgNum" class="ms-num">{{msgNum}}</view>
				</view>
			</template>
		</c-fub>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				msgNum: 3,
				img: require('../static/msg.png')
			}
		},
		methods: {
			// 点击了按钮
			openMsg() {
				console.log('点击了按钮');
			}
		}
	}
</script>

<style lang="scss" scoped>
	.msg {
		width: 50rpx;
		height: 50rpx;
		position: relative;

		.ms-img {
			width: 100%;
			height: 100%;
		}

		.ms-num {
			width: 24rpx;
			height: 24rpx;
			background: #F76B1C;
			border-radius: 30rpx;
			position: absolute;
			right: -5rpx;
			top: -5rpx;
			font-size: 16rpx;
			font-weight: 400;
			color: #FFFFFF;
			display: flex;
			justify-content: center;
			align-items: center;
		}
	}
</style>